package com.shiroha.common.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;

import java.io.Serial;

@Getter
public abstract class ServiceException extends RuntimeException {
    @Serial
    private static final long serialVersionUID = 1L;

    private final HttpStatus errorCode;

    public ServiceException(String message) {
        super(message);
        this.errorCode = null;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
        this.errorCode = null;
    }

    public ServiceException(String message, HttpStatus errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public ServiceException(String message, HttpStatus errorCode, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }
}
